import { Pipe, PipeTransform } from '@angular/core';

@Pipe({
  name: 'padNumber'
})
export class PadNumberPipe implements PipeTransform {

  transform(value: any, length: number = 3): any {
    let str = String(value);
    while (str.length < length) {
      str = '0' + str;
    }
    return str;
  }
}
